Add a command to purge the relay chain only#306
Conversation
|
Tested and working: |
|
Commented on the issue |
|
bkchr
left a comment
There was a problem hiding this comment.
Please move and also please write some tests for the command on its own.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
bkchr
left a comment
There was a problem hiding this comment.
(and please don't forget the tests 🙈 )
I'm on it. You're too fast |
Sorry :P |
|
There is an issue with the The other problem with this is that it is also impacting the Meanwhile I have a few questions:
One other (very far fetched) alternative would be to give a big thought about moving away from structopt and changing completely sc-cli's API to use clap directly. It's less declarative but this is actually a good thing in term of flexibility. We might be able to achieve more with less complexity. |
You should make yourself familiar what this command is doing. From the perspective of cumulus the
We used clap before and it was horrible :P Yeah, it is more flexible, but you also loose all your shit when you try to modify something or to add a new parameter. So, no switch. |
I know that very well but my problem is still there. I will try to explain better: When you run cumulus you can give a Unfortunately, because of limitations with structopt, I can't parse the arguments after What I can do to circumvent this issue:
(I'm mostly using the parameter |
Wait, there is already a parameter |
Or maybe just make |
|
Ok I get it, the relay chain is actually found from the parachain's extension. So I just fixed the test. @bkchr this is ready for review then |
bkchr
left a comment
There was a problem hiding this comment.
Sorry for the late review. Some last nitpicks, otherwise looks good.
cli/src/lib.rs
Outdated
| .iter() | ||
| .map(|x| { | ||
| x.path().ok_or_else(|| { | ||
| sc_cli::Error::Input("Cannot purge custom database implementation".into()) |
There was a problem hiding this comment.
Maybe a hint which on this is, would be nice :D
|
|
||
| #[test] | ||
| #[cfg(unix)] | ||
| fn purge_chain_works() { |
There was a problem hiding this comment.
Would be really nice to have these tests part of the /tests/ "parachain". But this can be done in a later pr.
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
| }; | ||
|
|
||
| let base_path = "purge_chain_test"; | ||
| let base_path = tempfile::tempdir().unwrap(); |
There was a problem hiding this comment.
@cecton I'm curious why you did this after you already gave us the --tmp flag in paritytech/substrate#6221
There was a problem hiding this comment.
Oh, I get it. So you can check the directory later on.
Fixes #259